<?php 

// No direct access
defined ('_JEXEC') or die();

$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');

?>

<form action='index.php' method='post' name='adminForm' id='adminForm'>
	<input type="hidden" name="option" value="<?php echo $option; ?>" /> <input
		type="hidden" name="task" value="" /> <input type="hidden" name="view"
		value="<?php echo $view; ?>" /> <input type="hidden"
		name="filter_order" value="<?php echo $listOrder; ?>" /> <input
		type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
	<input type='hidden' name='boxchecked' value='0' />
	<?php 
	echo JHtml::_('form.token');
	echo JHTML::_('behavior.modal');
	?>

	<fieldset id='filter-bar'>
		<div class='filter-search fltlft'>
			<label for='filter_search'><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?>
			</label> <input type='text' name='filter_search' id='filter_search'
				value='<?php echo $this->escape($this->state->get('filter.search')); ?>'
				title='<?php echo JText::_('Enter product name') ?>' />
			<button type='submit'>
				<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
			</button>
			<button type='button'
				onclick='document.id("filter_search").value="";this.form.submit();'>
				<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>
			</button>
		</div>
	</fieldset>

	<div class="clr"></div>

	<div id='editcell'>
		<table class='adminlist'>
			<thead>
				<tr>
					<th width='1%'><input type='checkbox'
						onclick='Joomla.checkAll(this)'
						title='<?php echo JText::_('Check all')?>' />
					</th>
					<th><?php echo JHtml::_('grid.sort', 'ID', 'id', $listDirn, $listOrder)?>
					</th>
					<th><?php echo JHtml::_('grid.sort', 'Value', 'value', $listDirn, $listOrder); ?>
					</th>
					<th><?php echo JHtml::_('grid.sort', 'Unit', 'unit', $listDirn, $listOrder); ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan='4'><?php echo $this->pagination->getListFooter(); ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
				<?php
				if (!empty($this->items))
				{
					$k = 0;
					$i = 0;
					foreach ($this->items as $row)
					{
						$checked = JHtml::_('grid.id', $i++, $row->id);
						$link = JRoute::_('index.php?option=' . $option . '&task=shippingfee.edit&id=' . $row->id);
						?>
				<tr class="row<?=$k?>">
					<td><?php echo $checked; ?></td>
					<td><a href='<?php echo $link; ?>'><?php echo $row->id; ?> </a></td>
					<td><?php echo $row->value; ?></td>
					<td><?php echo $row->unit; ?></td>
				</tr>
				<?php
				$k = 1 - $k;
					}
				}
				?>
			</tbody>
		</table>
	</div>
</form>
